﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Net;
using System.ServiceModel;
using Model;

namespace PositionServer.Service
{
    [ServiceContract]
    public interface IPositionService
    {

        /// <summary>
        /// return 1 means succeed 
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int TestWCF();

       

        #region common Interface

        /// <summary>
        /// return nearby TaxiInfo 
        /// </summary>
        /// <param name="longitude"></param>
        /// <param name="latitude"></param>
        /// <param name="distance"> kilometer</param>
        /// <param name="type">0---Taxi,1---PhoneUser</param>
        /// <returns></returns>
        [OperationContract]
        List<Model.TaxiInfo> GetNearbyGps(double longitude, double latitude, double distance, int type);


        [OperationContract]
        List<Model.TaxiInfo> GetNearbyGpsByCompany(
            double longitude, double latitude, double distance, string company);

        #endregion

        #region platform Interface

        [OperationContract]
        OrderInfo GetAnOrder(int userId);

        [OperationContract]
        List<Model.OrderInfo> GetOrderList(int userId);        

        [OperationContract]
        int SubmitAnOrder(OrderInfo order);

        [OperationContract]
        string GetClientVersion();
      
        /// <summary>
        /// Verify client platform user name and password 
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        [OperationContract]
        bool CheckUser(string userName, string password);

        [OperationContract]
        bool ChangePassWordByUserName(string userName, string newPwd);

        [OperationContract]
        UserInfo CheckUserWithReturn(string userName, string password);

        [OperationContract]
        DataSet CompanyGetList(string strWhere);


        [OperationContract]
        bool UserAdd(Model.UserInfo model);

        [OperationContract]
        bool UserUpdate(Model.UserInfo model);

        [OperationContract]
        bool UserDelete(int id);

        [OperationContract]
        bool UserDeleteList(string idlist);

        [OperationContract]
        DataSet UserGetList(string strWhere);

        [OperationContract]
        bool UserExist(string userName);


        [OperationContract]
        bool RoleUpdate(int id, string name, string permission, string remark);

        [OperationContract]
        string[] GetRoleInfoByUserName(string username);

        [OperationContract]
        bool RoleAdd(Model.RoleInfo model);
        //[OperationContract]
        //bool RoleUpdate(Model.RoleInfo model);

        [OperationContract]
        bool RoleDelete(int id);

        [OperationContract]
        bool RoleDeleteList(string idlist);

        [OperationContract]
        DataSet RoleGetList(string strWhere);

        [OperationContract]
        bool RoleExist(string roleName);


         

        [OperationContract]
        bool GmapoverlayAdd(Model.GmapoverlayInfo model);

        [OperationContract]
        bool GmapoverlayUpdate(Model.GmapoverlayInfo model);

        [OperationContract]
        bool GmapoverlayDelete(int id);

        [OperationContract]
        Model.GmapoverlayInfo GmapoverlayGetModel(int id);

        [OperationContract]
        DataSet GmapoverlayGetList(string strWhere);

        [OperationContract]
        DataSet GmapoverlayGetListByParameter(string parameter, string parameterVaule);

        [OperationContract]
        int GmapoverlayGetRecordCount(string strWhere);

         

        [OperationContract]
        void AddTaxiGpsHistoryInfo(Model.TaxiGpsHistoryInfo taxiGpsHistoryInfo);

        [OperationContract]
        DataSet TaxiGpsHistoryGetList(string driverPhoneNumber, DateTime startTime, DateTime endTime);

        [OperationContract]
        DataSet TaxiGpsHistoryGetListWhere(string strWhere);




        [OperationContract]
        bool PhoneUserAdd(Model.PhoneUserInfo model);

        

        [OperationContract]
        bool PhoneUserDelete(int id);

        [OperationContract]
        Model.PhoneUserInfo PhoneUserGetModel(int id);

        [OperationContract]
        DataSet PhoneUserGetList(string strWhere);


        #region Driver
         [OperationContract]
        bool DriverExistsCardId(string cardId);

         [OperationContract]
        bool DriverAdd(DriverInfo model);

         [OperationContract]
        bool DriverUpdate(DriverInfo model);

         [OperationContract]
        bool DriverUpdateState(string phoneNumber, int state);

         [OperationContract]
        bool DriverChangePassword(string cardId, string oldPwd, string newPwd);

         [OperationContract]
        bool DriverDelete(int id);

          [OperationContract]
        DriverInfo DriverGetModelByPhoneNum(string phoneNumber);

         [OperationContract]
        DataSet DriverGetList(string strWhere);
     
        #endregion

         #region Taxi

        [OperationContract]
        bool TaxiExistsPhoneNum(string phoneNumber);

        [OperationContract]
        bool TaxiAdd(TaxiInfo model);

        [OperationContract]
        bool TaxiUpdate(TaxiInfo model);

        [OperationContract]
        bool TaxiUpdateState(string phoneNumber, int state);

        [OperationContract]
        bool TaxiDelete(int id);

        [OperationContract]
        DataSet TaxiGetList(string strWhere);
          
         #endregion

        [OperationContract]
        DataSet OrderGetList(string strWhere);

        [OperationContract]
        List<Model.TaxiInfo> GetGpsByCompny(string companyNmae);



        #endregion
    }
}
